import fetch from '@/api'

//列表
export function getAcceptanceInList(params) {
    return fetch({
        method: 'get',
        url: `/accept/page`,
        params,
    })
}
// 验收
export function addAcceptance(id,data) {
    return fetch({
        method: 'post',
        url: `/accept/accept/${id}`,
        data
    })
}

// 複核
export function checkAcceptanceIn(data) {
    return fetch({
        method: 'post',
        url: `/accept/check`,
        data
    })
}

// 修改
export function updateAcceptanceIn(id,data) {
    return fetch({
        method: 'post',
        url: `/accept/update/${id}`,
        data
    })
}

// 转化为存单
export function toDepositReceipt(data) {
    return fetch({
        method: 'post',
        url: `/accept/conversion`,
        data
    })
}
// // 删除
// export function deleteAcceptanceIn(entrustNo) {
//     return fetch({
//         method:'delete',
//         url:`/entrust/${entrustNo}`
//     })
// }

//提交
export function submitAcceptanceIn(id, data) {
    return fetch({
        method: 'put',
        url: `/accept/${id}`,
        data,
    })
}

// 退回
export function rebackAcceptanceIn(id, data) {
    return fetch({
        method: 'post',
        url: `/accept/return/${id}`,
        data,
    })
}

//添加明细：根据跟踪号查询验收单明细
export function getDetailList(id,trackingNo,params) {
    return fetch({
        method: 'get',
        url: `/accept/get/${id}/${trackingNo}`,
        params,
    })
}
